<div class="col-xs-12" >
<div class="panel panel-default">
  <div class="panel-heading">卡产品信息</div>

<div class="panel-body">
    <div class="container-fluid form-horizontal ">

<div class="col-xs-10 col-xs-offset-1 form-horizontal" >
	
	<div class="form-group">
		<label class="col-xs-3 control-label">产品名称</label>
		<div class="col-xs-9">
			<input type="text" class="form-control" 
			ng-model="obj.name"
			>
		</div>
	</div>

	<div class="form-group">
		<label class="col-xs-3 control-label">卡产品分类</label>
		<div class="col-xs-9">
			<select class="form-control" ng-model="obj.card_type" 
              ng-options="cardtype.value as cardtype.label for cardtype in cardtypearr"
            >
            <option value="">请选择</option>
            </select>
		</div>
	</div>

	<div class="form-group">
		<label class="col-xs-3 control-label">市场价格</label>
		<div class="col-xs-9">
			<div class="input-group">
				<span class="input-group-addon">¥</span>
				<input type="number" class="form-control" placeholder="请输入市场价格" min='0'
				ng-model="obj.market_price"
				>
			</div>
		</div>
	</div>

	<div class="form-group">
		<label class="col-xs-3 control-label">居游价格</label>
		<div class="col-xs-9">
			<div class="input-group">
				<span class="input-group-addon">¥</span>
				<input type="number" class="form-control" placeholder="请输入居游价格" min='0'
				ng-model="obj.guide_price"
				>
			</div>
		</div>
	</div>

	<div class="form-group">
	    <label class="col-xs-3 control-label">是否绑定用户信息</label>
	    <div class="col-xs-9">
	    	<label class="radio-inline">
			  <input type="radio" name="operation" value="1"
			  ng-model="obj.operation"
			  > 不绑定
			</label>
			<label class="radio-inline">
			  <input type="radio" name="operation" value="2"
			  ng-model="obj.operation"
			  > 绑定
			</label>
	    </div>
  	</div>

	<div class="form-group">
	    <label class="col-xs-3 control-label">支付类型</label>
	    <div class="col-xs-9">
	    	<label class="radio-inline">
			  <input type="radio" name="pay_type" value="0"
			  ng-model="obj.pay_type"
			  > 需要支付
			</label>
			<label class="radio-inline">
			  <input type="radio" name="pay_type" value="1"
			  ng-model="obj.pay_type"
			  > 无需支付
			</label>
	    </div>
  	</div>

  	<div class="form-group">
	    <label class="col-xs-3 control-label">库存类型</label>
	    <div class="col-xs-3">
	    	<label class="radio-inline">
			  <input type="radio" name="stock_type" value="0"
			  ng-model="obj.stock_type"
			  > 不启用
			</label>
			<label class="radio-inline">
			  <input type="radio" name="stock_type" value="1"
			  ng-model="obj.stock_type"
			  > 启用
			</label>
	    </div>
	    <div class="col-xs-2" ng-show="obj.stock_type == 1">
	    	<input type="number" class="form-control" placeholder="预存数量" min='0' ng-model="obj.current_stock_num"
			>
	    </div>
  	</div>

  	<div class="form-group">
	    <label class="col-xs-3 control-label">最大购买数量限制</label>
	    <div class="col-xs-2">
	    	<input type="number" class="form-control" 
			ng-model="obj.max_limit"
			>
			
	    </div>
	    <div class="col-sm-5">
	      <p class="form-control-static text-danger" > -1:不限，其他数字:限制购买个数</p>
	    </div>
  	</div>

  	<div class="form-group">
	    <label class="col-xs-3 control-label">限制规则</label>
	    <div class="col-xs-4">
	    	<label class="radio-inline">
			  <input type="radio" name="max_limit_type" value="0"
			  ng-model="obj.max_limit_type"
			  > 平台
			</label>
			<label class="radio-inline">
			  <input type="radio" name="max_limit_type" value="1"
			  ng-model="obj.max_limit_type"
			  > 所属区域
			</label>
			<label class="radio-inline">
			  <input type="radio" name="max_limit_type" value="2"
			  ng-model="obj.max_limit_type"
			  > 指定区域
			</label>
	    </div>
	    <div class="col-xs-2" ng-show="obj.max_limit_type == 2">
	    	<input type="text" class="form-control" placeholder="指定区域进行限制" ng-model="obj.max_limit_area"
			>
	    </div>
  	</div>

	<div class="form-group">
	    <label class="col-xs-3 control-label">实名制类型</label>
	    <div class="col-xs-9">
	    	<label class="radio-inline">
			  <input type="radio" name="realname_type" value="0"
			  ng-model="obj.realname_type"
			  > 需要实名制
			</label>
			<label class="radio-inline">
			  <input type="radio" name="realname_type" value="1"
			  ng-model="obj.realname_type"
			  > 无需实名制
			</label>
	    </div>
  	</div>

  	<div class="form-group form-inline">
	    <label class="col-xs-3 control-label">是否出票</label>
	    <div class="col-xs-9">
	    	<label class="radio-inline">
			  <input type="radio" name="outticket" value="1"
			  ng-model="obj.outticket"
			  > 不出票
			</label>
	    	<label class="radio-inline">
			  <input type="radio" name="outticket" value="0"
			  ng-model="obj.outticket"
			  > 出票
			</label>
	    </div>
  	</div>

  	<div class="form-group form-inline">
	    <label class="col-xs-3 control-label">是否出券</label>
	    <div class="col-xs-9">
	    	<label class="radio-inline">
			  <input type="radio" name="outvoucher" value="1"
			  ng-model="obj.outvoucher"
			  >不出券
			</label>
	    	<label class="radio-inline">
			  <input type="radio" name="outvoucher" value="0"
			  ng-model="obj.outvoucher"
			  > 出券
			</label>
			&nbsp;&nbsp;&nbsp;&nbsp;
			<select class="form-control" ng-model="obj.voucher_code" ng-show="obj.outvoucher=='0'"
              ng-options="voucher.CODE as voucher.product_name for voucher in voucherarr"
            >
            <option value="">请选择</option>
            </select>
	    </div>
  	</div>

  	<div class="form-group form-inline">
	    <label class="col-xs-3 control-label">红包</label>
	    <div class="col-xs-9 form-inline">
		    <label class="radio-inline">
			 <input type="radio" name="rebate_type" value="0"
				  ng-model="obj.rebate_type" ng-click="change()"
				  >否</label>

		    <label class="radio-inline">
			<input type="radio" name="rebate_type" value="1"
				  ng-model="obj.rebate_type"
				  >是</label>
		    &nbsp;&nbsp;&nbsp;&nbsp;
			<select class="form-control" ng-model="obj.rebate_code" ng-show="obj.rebate_type=='1'"
              ng-options="redtype.code as redtype.name for redtype in redtypearr"
            >
            <option value="">请选择</option>
            </select>
	    </div>
  	</div>

  	<div class="form-group form-inline">
	    <label class="col-xs-3 control-label">是否独立</label>
	    <div class="col-xs-9 form-inline">
		    <label class="radio-inline">
			 <input type="radio" name="independent" value="0"
				  ng-model="obj.independent"
				  >不独立</label>

		    <label class="radio-inline">
			<input type="radio" name="independent" value="1"
				  ng-model="obj.independent"
				  >独立</label>
            </select>
	    </div>
  	</div>

  	<!--<div class="form-group">
	    <label class="col-xs-3 control-label" >是否分润</label>
	    <div class="col-xs-3">
					<label class="radio-inline">
					<input type="radio" name="isshareprofit" value="0"
					ng-model="obj.isshareprofit"
					> 不分润
				</label>
				<label class="radio-inline">
					<input type="radio" name="isshareprofit" value="1"
					ng-model="obj.isshareprofit"
					> 分润
				</label>
	    </div>
	    <div class="col-xs-2" ng-show="obj.isshareprofit == 1">
	    	<input type="number" class="form-control" placeholder="分润比例" min='0' ng-model="obj.proportion"
			>
	    </div>
  	</div>-->

	<div class="form-group">
		<label class="col-xs-3 control-label">备注</label>
		<div class="col-xs-9">
			<textarea class="form-control" rows="3"
			ng-model="obj.remarks"
			></textarea>
		</div>
	</div>

	<div class="form-group">
		<label class="col-xs-3 control-label">顶图</label>
		<div class="col-xs-9">
			<img ng-src="{{obj.img}}" width="250" height="150" ng-model="obj.img">
			<input type="file" nv-file-select uploader="baseinfo.imageshow.img" />
			<br>
			<ul class="list-group">
			    <li class="list-group-item" 
			    ng-repeat="item in baseinfo.imageshow.img.queue">
			        文件名: <span ng-bind="item.file.name"></span>
			        <button type="button" class="btn btn-default btn-xs"  ng-click="item.upload()"><span class="glyphicon glyphicon-upload"></span> 上传</button>
			        <div class="progress mt10">
			            <div class="progress-bar" role="progressbar" ng-style="{ 'width': baseinfo.imageshow.img.progress + '%' }"></div>
			        </div>
			    </li>
			</ul>
		</div>
	</div>

	<button 
    type="button" 
    class="btn btn-info col-xs-1 pull-right" 
    ng-click="gogo()"
    >
    提交
    </button>

</div>

</div>
</div>
</div>





<div class="panel panel-default">
  <div class="panel-heading">卡产品资源</div>

<div class="panel-body">
    <div class="container-fluid form-horizontal ">

<div class="col-xs-10 col-xs-offset-1 form-horizontal" >
	
	<div class="form-group">
		<label class="col-xs-2 control-label">资源列表 </label>
		<div class="col-xs-2" >
			<select class="form-control" ng-model="resobj.sub_table_code" 
              ng-options="subtable.value as subtable.label for subtable in subtablearr"
            >
            </select>
        </div>
        <div class="col-xs-3" >
        	<label class="radio-inline">
			  <input type="radio" name="sub_table_used_type" 
			  ng-model="resobj.sub_table_used_type" value="0"> 资源校验
			</label>
			<label class="radio-inline">
			  <input type="radio" name="sub_table_used_type" 
			  ng-model="resobj.sub_table_used_type" value="1"> 无需校验
			</label>
        </div>
        <div class="col-xs-3" >
        	<label class="radio-inline">
			  <input type="radio" name="sub_table_data_type" 
			  ng-model="resobj.sub_table_data_type" value="0"> 一对一
			</label>
			<label class="radio-inline">
			  <input type="radio" name="sub_table_data_type" 
			  ng-model="resobj.sub_table_data_type" value="1"> 一对多
			</label>
        </div>
        <div class="col-xs-2" >
        	<button 
		    type="button" 
		    class="btn btn-success pull-right" 
		    ng-click="resourcesok()"
		    >
		    添加
		    </button>

        </div>


	</div>


	<div class="panel panel-default col-xs-8 col-xs-offset-2">
		<table class="table">
        <tbody>
          <tr ng-repeat="res in resources">
            <td>{{res.sub_table_name}}</td>
            <td>{{res.sub_table_data_name}}</td>
            <td>{{res.sub_table_used_name}}</td>
            <td>
	           	<a ng-click="resourcesdel(res.sub_table_code, res.product_code)" class="btn pull-right" style="color: red; padding:0px;" >
	        	<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
	      		</a>
            </td>
          </tr>
        </tbody>
      </table>
	</div>



</div>

</div>
</div>
</div>




<div class="panel panel-default" ng-show="resourcesflag.pool !== undefined">
  <div class="panel-heading">卡池</div>

<div class="panel-body">
    <div class="container-fluid form-horizontal ">

<div class="col-xs-10 col-xs-offset-1 form-horizontal" >
	
	<div class="form-group">
		<label class="col-xs-2 control-label">选择卡池</label>
		<div class="col-xs-8">
			<select class="form-control" ng-model="cardpoolobj.pool_code" 
              ng-options="cardpool.pool_code as cardpool.pool_name for cardpool in cardpoolarr" ng-change="selection()">
            <option value="">请选择卡池</option>
            </select>
		</div>
		<div class="col-xs-2" >
        	<button 
		    type="button" 
		    class="btn btn-success pull-right" 
		    ng-click="cardpoolok()"
		    >
		    添加
		    </button>

        </div>
	</div>

	<div class="panel panel-default col-xs-8 col-xs-offset-2">
		<table class="table">
        <tbody>
          <tr ng-repeat="cardpool in cardproduct_cardpoollistarr">
            <td>{{cardpool.pool_name}}</td>
            <td>
	           	<a ng-click="cardpooldel(cardpool.pool_code)" class="btn pull-right" style="color: red; padding:0px;" >
	        	<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
	      		</a>
            </td>
          </tr>
        </tbody>
      </table>
	</div>

	<!-- <button 
    type="button" 
    class="btn btn-success btn-lg col-xs-3 pull-right" 
    ng-click="gogo()"
    >
    提交
    </button> -->

</div>

</div>
</div>
</div>




<div class="panel panel-default" ng-show="resourcesflag.ticket !== undefined">
  <div class="panel-heading">票销售品</div>

<div class="panel-body">
    <div class="container-fluid form-horizontal ">

<div class="col-xs-10 col-xs-offset-1 form-horizontal" >
	
	<div class="form-group">
		<label class="col-xs-2 control-label">填写销售品编号</label>
		<div class="col-xs-8">
			<input type="text" class="form-control" 
			ng-model="ticketobj.ticket_code"
			>
		</div>
		<div class="col-xs-2" >
        	<button 
		    type="button" 
		    class="btn btn-success pull-right" 
		    ng-click="ticketok()"
		    >
		    添加
		    </button>

        </div>
	</div>


	<div class="panel panel-default col-xs-8 col-xs-offset-2">
		<table class="table">
        <tbody>
          <tr ng-repeat="ticket in cardproduct_ticketarr">
            <td><a ng-click="ticketinfo(ticket.ticket_code)" style="cursor:pointer">{{ticket.ticket_code}}</a></td>
            <td>
	           	<a ng-click="ticketdel(ticket.ticket_code)" class="btn pull-right" style="color: red; padding:0px;" >
	        	<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
	      		</a>
            </td>
          </tr>
        </tbody>
      </table>
	</div>

	<!--<button 
    type="button" 
    class="btn btn-info col-xs-1 pull-right" 
    ng-click="submit()"
    >
    提交
    </button>-->

</div>

</div>
</div>
</div>



